package org.jivesoftware.smackx.snyc.packet;

import org.jivesoftware.smack.packet.NamedElement;
import org.jivesoftware.smack.util.XmlStringBuilder;

public class RosterItem implements NamedElement {
    public static final String ELEMENT = "item";

    private String jid;
    private String name;
    private String subscription;



//    public RosterItem(String jid, String name, String subscription) {
//        this.jid = jid;
//        this.name = name;
//        this.subscription = subscription;
//    }

    public String getJid() {
        return jid;
    }

    public void setJid(String jid) {
        this.jid = jid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSubscription() {
        return subscription;
    }

    public void setSubscription(String subscription) {
        this.subscription = subscription;
    }

    @Override
    public CharSequence toXML() {
        XmlStringBuilder itemBuilder = new XmlStringBuilder(this);

        itemBuilder.attribute("jid", this.jid);
        itemBuilder.optAttribute("name", this.name);
        itemBuilder.optAttribute("subscription", this.subscription);
        itemBuilder.rightAngleBracket();

        itemBuilder.closeElement(this);

        return itemBuilder;
    }

    @Override
    public String getElementName() {
        return ELEMENT;
    }
}
